home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pesquisa Dirigida
/
Pesquisa Dirigida.iso
/
JOGOS
/
mini_putt2.swf
/
scripts
/
DefineSprite_196
/
frame_1
/
DoAction.as
Wrap
Text File
|
2005-01-07
|
1KB
|
55 lines
tellTarget("..")
{
xdir = (ball._x - putter._x) * 0.33;
ydir = (ball._y - putter._y) * 0.33;
node1._x = ball._x + xdir * 4.5;
node1._y = ball._y + ydir * 4.5;
node2._x = ball._x + xdir * 2.75;
node2._y = ball._y + ydir * 2.75;
node3._x = ball._x + xdir * 1.5;
node3._y = ball._y + ydir * 1.5;
node4._x = ball._x + xdir * 0.5;
node4._y = ball._y + ydir * 0.5;
}
set("../:speed",eval("../:xdir") * eval("../:xdir") + eval("../:ydir") * eval("../:ydir"));
if(775 < eval("../:speed"))
{
tellTarget("../node1")
{
gotoAndStop(2);
}
tellTarget("../node2")
{
gotoAndStop(2);
}
tellTarget("../node3")
{
gotoAndStop(2);
}
tellTarget("../node4")
{
gotoAndStop(2);
}
}
else
{
tellTarget("../node1")
{
gotoAndStop(1);
}
tellTarget("../node2")
{
gotoAndStop(1);
}
tellTarget("../node3")
{
gotoAndStop(1);
}
tellTarget("../node4")
{
gotoAndStop(1);
}
}
eval("../:putt")._x = eval("../:putter")._x;
eval("../:putt")._y = eval("../:putter")._y;